package cn.cvs.dao;

import cn.cvs.entity.StorageRecord;
import org.apache.ibatis.annotations.Param;

import java.util.List;



    /**
     * 供货单数据层接口
     */
    public interface StorageRecordMapper {

        /**
         * 根据供应商ID查询订单数量
         * @param supplierId
         * @return
         * @throws Exception
         */
        public int selectCountBySupplierId(@Param("supplierId") Integer supplierId)throws Exception;


        /**
         * 增加订单
         * @param storageRecord
         * @return
         * @throws Exception
         */
        public int add(StorageRecord storageRecord)throws Exception;

        /**
         * 条件查询供货单列表数据
         * @param goodsName
         * @param supplierId
         * @param payStatus
         * @param pageBegin
         * @param pageSize
         * @return
         * @throws Exception
         */
        public List<StorageRecord> selectList(@Param("goodsName") String goodsName,
                                              @Param("supplierId") Integer supplierId,
                                              @Param("payStatus") Integer payStatus,
                                              @Param("pageBegin") Integer pageBegin,
                                              @Param("pageSize") Integer pageSize)throws Exception;

        /**
         * 条件查询供货单总数
         * @param goodsName
         * @param supplierId
         * @param payStatus
         * @return
         * @throws Exception
         */
        public int selectCount(@Param("goodsName") String goodsName, @Param("supplierId") Integer supplierId
                , @Param("payStatus") Integer payStatus)throws Exception;

        /**
         * 根据id删除供货单
         * @param id
         * @return
         * @throws Exception
         */
        public int deleteById(@Param("id") Integer id)throws Exception;


        /**
         * 根据id查询供货单
         * @param id
         * @return
         * @throws Exception
         */
        public StorageRecord selectById(@Param("id") Integer id)throws Exception;

        /**
         * 修改订单信息
         * @param storageRecord
         * @return
         * @throws Exception
         */
        public int update(StorageRecord storageRecord)throws Exception;

        /**
         * 根据供应商ID删除订单信息
         * @param supplierId
         * @return
         * @throws Exception
         */
        public int deleteBySupplierId(@Param("supplierId") Integer supplierId)throws Exception;

    }


